package toy.keli.picmap.tools;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.TextView;

import toy.keli.picmap.R;

public class StatusBar extends  Tools{
    private Handler myMessageHeader;
    TextView showBox;

    @Override
    public void bindActivity(Activity act) {
        super.bindActivity(act);
        myMessageHeader=new Handler(){
            public void handleMessage(Message msg){
                String text=msg.getData().getString("text");
                showText(text);
                super.handleMessage(msg);
            }
        };
        showBox=act.findViewById(R.id.share_title);
    }

    void showText(String text){
        showBox.setText(text);
    }
    public void setText(String text){
        Message m=new Message();
        Bundle d = new Bundle();
        d.putString("text",text);
        m.setData(d);
        myMessageHeader.sendMessage(m);
    }
}
